<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>意见列表 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head_list.html"/>
<script type="text/javascript">
$().ready(function() {
	<#if pagination.totalCount==0>
		$.message("warn", "暂无数据！");
	</#if>
	
	var $listForm = $("#listForm");
	var $filterSelect = $("#filterSelect");
	var $filterOption = $("#filterOption a");
	
	var mouseoverfun = function() {
		var $this = $(this);
		var offset = $this.offset();
		var $menuWrap = $this.closest("div.menuWrap");
		var $popupMenu = $menuWrap.children("div.popupMenu");
		$popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
		$menuWrap.mouseleave(function() {
			$popupMenu.hide();
		});
	}
	
	var clickfun = function() {
		var $this = $(this);
		var $dest = $("#" + $this.attr("name"));
		if ($this.hasClass("checked")) {
			$dest.val("");
		} else {
			$dest.val($this.attr("val"));
		}
		$listForm.submit();
		return false;
	}
	
	var eachfun = function(i,e){
		var $this = $(this);
		if( $this.attr("val") == filterStatus ){
			$this.addClass('checked');
		}
	}
	
	$filterSelect.mouseover(mouseoverfun);
	$filterOption.click(clickfun);
	
	var filterStatus = '${filterStatus!}';
	$.each($filterOption, eachfun);
});

</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 意见列表 <span>(共<span id="pageTotal">${pagination.totalCount!0}</span>条记录)</span>
	</div>
	<form id="listForm"  class="clearfix" action="v_list.jspx" method="post">
		<input type="hidden" name="cid"  value="${cid!}" />
 		<div class="bar">
 			<@betou_perm url="/suggestion/o_save.jspx">
			<a href="v_add.jspx" class="iconButton"><span class="addIcon">&nbsp;</span>添加</a>
			</@betou_perm>
			<div class="buttonWrap">
				<@betou_perm url="/suggestion/o_delete.jspx">
				<a href="javascript:;" id="deleteButton" class="iconButton disabled"><span class="deleteIcon">&nbsp;</span>删除</a>
				</@betou_perm>
				<a href="javascript:;" id="refreshButton" class="iconButton"><span class="refreshIcon">&nbsp;</span>刷新</a>
				<#if suggestionType?? && statusType??>
				<div class="menuWrap">
					<a class="button" id="filterSelect" href="javascript:;">筛选<span class="arrow">&nbsp;</span></a>
					<div class="popupMenu" style="left: 139px; top: 59px; display: none;">
						<ul class="check" id="filterOption">
							<#list statusType as c>
							<li><a val="status,${c.key!},integer"  name="filterStatus" href="javascript:;">状态：${c.value!}</a></li>
							</#list>
							<#list suggestionType as c>
							<li><a val="type.typeId,${c.typeId!},integer" name="filterStatus" href="javascript:;">类型：${c.name!}</a></li>
							</#list>
						</ul>
					</div>
				</div>
				</#if>
				<#include "../pageselect.html"/>
			</div>
			<div class="menuWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">&nbsp;</span>
					<input type="text"  id="searchValue" name="searchValue" value="${searchValue!}" maxlength="200" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
						<li><a href="javascript:;" val="title">标题</a></li>
						<li><a href="javascript:;" val="admin.username">发布人</a></li>
					</ul>
				</div>
			</div>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check"><input type="checkbox" id="selectAll" /></th>
				<th><a href="javascript:;" class="sort" name="title">标题</a></th>
				<th><a href="javascript:;" class="sort" name="type.name">类型</a></th>
				<th><a href="javascript:;" class="sort" name="addDate">提交日期</a></th>
				<th><a href="javascript:;" class="sort" name="admin.username">提交人</a></th>
				<th><a href="javascript:;" class="sort" name="status">状态</a></th>
				<th><span>操作</span></th>
			</tr>
			<#list pagination.list as c>
				<tr>
					<td><input type="checkbox" name="ids"  title=""  value="${c.id!}" /></td>
					<td><a href="v_edit.jspx?id=${c.id!}" title="查看详情">${c.title!?html}</a></td>
					<td><span class="green">${(c.type.name)!}</span></td>
					<td><span title="${c.addDate?string('yyyy-MM-dd hh:mm:ss')}">${c.addDate?string('yyyy-MM-dd hh:mm')}</span></td>
					<td>${(c.admin.username)!}</td>
					<td><span class="<#if c.status=1 >green<#elseif c.status=5 >red<#else></#if>" >${(c.statusName)!}<span></td>
					<td>
						<#if c.status == 1 || admin.id==c.admin.id>
							<a href="v_edit.jspx?id=${c.id!}">[查看]</a>
						<#else>
							<a href="v_edit.jspx?id=${c.id!}#answer">[反馈]</a>
						</#if>
					</td>
				</tr>
			</#list>
		</table>
		<#include "../list_hidden.html" />
		<#include "../page.html" />
	</form>
	<#include "../footer.html"/>
</body>
</html>